// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch
{
	public sealed partial class CoordsGeoBounds
	{
		[JsonInclude]
		[JsonPropertyName("bottom")]
		public double Bottom { get; set; }

		[JsonInclude]
		[JsonPropertyName("left")]
		public double Left { get; set; }

		[JsonInclude]
		[JsonPropertyName("right")]
		public double Right { get; set; }

		[JsonInclude]
		[JsonPropertyName("top")]
		public double Top { get; set; }
	}

	public sealed partial class CoordsGeoBoundsDescriptor : SerializableDescriptorBase<CoordsGeoBoundsDescriptor>
	{
		internal CoordsGeoBoundsDescriptor(Action<CoordsGeoBoundsDescriptor> configure) => configure.Invoke(this);
		public CoordsGeoBoundsDescriptor() : base()
		{
		}

		private double BottomValue { get; set; }

		private double LeftValue { get; set; }

		private double RightValue { get; set; }

		private double TopValue { get; set; }

		public CoordsGeoBoundsDescriptor Bottom(double bottom)
		{
			BottomValue = bottom;
			return Self;
		}

		public CoordsGeoBoundsDescriptor Left(double left)
		{
			LeftValue = left;
			return Self;
		}

		public CoordsGeoBoundsDescriptor Right(double right)
		{
			RightValue = right;
			return Self;
		}

		public CoordsGeoBoundsDescriptor Top(double top)
		{
			TopValue = top;
			return Self;
		}

		protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings)
		{
			writer.WriteStartObject();
			writer.WritePropertyName("bottom");
			writer.WriteNumberValue(BottomValue);
			writer.WritePropertyName("left");
			writer.WriteNumberValue(LeftValue);
			writer.WritePropertyName("right");
			writer.WriteNumberValue(RightValue);
			writer.WritePropertyName("top");
			writer.WriteNumberValue(TopValue);
			writer.WriteEndObject();
		}
	}
}